import React, { Component } from 'react';
import {
    Flex,
    Icon,
    Modal,
    Carousel,
    WingBlank,
    WhiteSpace,
    Toast,
    Popover
} from 'antd-mobile';
import CanChangeScroll from '../../components/CanChangeScroll/CanChangeScroll';
import Moment from 'moment';
import NoLazyImg from '../../components/NoLazyImg/NoLazyImg';
import xing from '../../assets/svg/xing.svg';
import xing2 from '../../assets/svg/xing2.svg';
import share from '../../assets/svg/share.svg';
import dianzan from '../../assets/svg/dianzan.svg';
import dianzan1 from '../../assets/svg/dianzan1.svg';
import pinglun from '../../assets/svg/pinglun.svg';
import {evalute_madel} from "../evaluate/EvaluateListItem.less";
import {findFollow} from './findIndex.less';
import { routerRedux } from 'dva/router';

//const Item = Popover.Item;

class MyFansListItem extends Component {
    constructor(props){
        super(props);
        this.state={
            guanzhu:true
        };

    }



    render () {
        console.log(this.props)
        const { v, dispatch } = this.props;
        let { guanzhu} = this.state;

        return <div className={findFollow}>
            <WingBlank>
                <Flex justify="between" style={{borderBottom:"1px solid #e5e5e5",paddingTop:".2rem",paddingBottom:".2rem"}}>
                    <Flex style={{width:"70%"}} onClick={()=>{
                             this.props.dispatch(routerRedux.push({
                                  pathname:`/personHome/${v.memberId}/${0}`
                             }))
                        }}>
                        <div style={{width:".8rem",height:".8rem",borderRadius:"100%",marginRight:".2rem"}}>
                            <NoLazyImg src={v.fansImage !=undefined?v.fansImage :""}  style={{width:".8rem",height:".8rem",borderRadius:"100%"}}></NoLazyImg>
                        </div>
                        <div>
                            <div style={{fontSize:".3rem"}}>{v.memberName }</div>
                            <Flex  style={{color:"#999",margin:".2rem 0"}}>
                                <div style={{marginRight:".2rem"}}>粉丝数{v.fansNum }</div>
                                <div>发布{v.pieceNum }篇</div>
                            </Flex>
                            <div className="connet" style={{fontSize:".27rem"}}>{v.connet}</div>
                        </div>
                    </Flex>
                    <div className={v.isConner ==1?"guanzhu":"guanzhu1"} onClick={()=>{
                        // if(v.isConner ==1){return false}
                        this.props.dispatch({type:"findOthers/connerFollowEFF",obj:{connerId:v.memberId   }}).then(result=>{
                            if(result.code==200){
                                Toast.success(result.msg,1.5,()=>{
                                   this.props.refresh();
                                })
                            }
                        })
                    }}>{v.isConner ==1?"互相关注":"关注"}</div>
                </Flex>
            </WingBlank>
        </div>;
    }
}

export default MyFansListItem;
